// 本地存储的模块，这个模块制作本地存储
const TOKEN_KEY = 'hm-82-tokenInfo'
const HISTORY_KEY = 'hm-82-history'
// 存储token
export const setToken = (obj) => {
  localStorage.setItem(TOKEN_KEY, JSON.stringify(obj))
}
// 获取token
export const getToken = () => {
  return JSON.parse(localStorage.getItem(TOKEN_KEY)) || {}
}
// 移除token
export const removeToken = () => {
  localStorage.removeItem(TOKEN_KEY)
}

// 存储History
export const setHistory = (obj) => {
  localStorage.setItem(HISTORY_KEY, JSON.stringify(obj))
}
// 获取History
export const getHistory = () => {
  return JSON.parse(localStorage.getItem(HISTORY_KEY)) || []
}
// 移除History
export const removeHistory = () => {
  localStorage.removeItem(HISTORY_KEY)
}
